<h1><%= "Pseuds for %s".t / @user.login -%></h1>

<% if current_user == @user -%>
<ul class="navigation">
<li><%= link_to 'New pseud'.t, new_user_pseud_path(@user) %></li>
</ul>
<% end -%>
<table>
<caption><!--A summary of the table contents and purpose here please--></caption>
  <tr>
    <th scope="col"><%=h 'Name'.t %></th>
    <th scope="col"><%=h 'Description'.t %></th>
    <th scope="col"><%=h 'Is default'.t %></th>
  </tr>
<% for pseud in @pseuds %>
  <tr>
    <th scope="row"><%=h pseud.name %></th>
    <td><%=h pseud.description %></td>
    <td><%=h pseud.is_default %></td>
    <td class="navigation"><ul class="navigation">
	<li><%= link_to 'Show'.t, [@user, pseud] %></li>
	<% if current_user == @user -%>
		<li><%= link_to 'Edit'.t, [:edit, @user, pseud] -%></li>
     	<li><%= link_to 'Orphan Works'.t, {:controller => 'orphans', :action => 'new', :pseud_id => pseud.id} -%>
		 <% unless @user.login == pseud.name || pseud.is_default -%></li>
 		 <li><%= link_to 'Destroy'.t, [@user, pseud], :confirm => 'Are you sure?'.t, :method => :delete %></li>
		 <% end -%>
	<% end -%>
	</ul>
	</td>
  </tr>
<% end %>
</table>
<ul class="navigation">
<li><%= link_to 'New pseud'.t, new_user_pseud_path(@user) %></li>
</ul>

